/**
** Created by Kstar on 2022/1/12.
**/

//

#include "Food.h"

Food::Food(int cx, int cy, int cTime, int cspeed, int csex, int catk, int clife,
           int cendurance,int cenergy): Creature(cx,cy,cTime),Animal(cx, cy, cTime,cspeed, csex, catk, clife, cendurance) {
    energy = cenergy;
}

void Food::eatten(Animal &animal) {
    animal.addLife(energy);
    animal.setEndurance(animal.getEndurance()+energy);
}